<template>
<div >
  <el-carousel :interval="3000" arrow="always" :height="height + 'px'">
    <el-carousel-item v-for="item in list" :key="item">
      <img :src="item" alt="">
    </el-carousel-item>
  </el-carousel>
</div>
</template>

<script>
import {ref} from "vue";

export default {
  name: "Carousel",
  props: {
    height: {
      type: Number,
      default: 360
    }
  },
  setup(props) {
      const list = [require('@/static/风景1.jpg'), require('@/static/风景2.png'), require('@/static/风景3.jpg')]
    return {
      list
    }
  }
}
</script>

<style lang="scss" scoped>

img {
  width: 100%;
  height: 100%;
}

.el-carousel__item h3 {
  color: #475669;
  font-size: 18px;
  opacity: 0.75;
  line-height: 300px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>